package net.xju_springJdbc11_12.service.impl;

import net.xju_springJdbc11_12.dao.StudentDao;
import net.xju_springJdbc11_12.entity.Student;
import net.xju_springJdbc11_12.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.FileNotFoundException;
import java.util.Collections;
import java.util.List;

@Service
public class StudentServiceImpl  implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> getAllStudents() {
        return studentDao.getStudents();
    }

    @Override
    public void addStudent(Student student) throws FileNotFoundException {
        studentDao.insert(student);
    }
}
